package co.yixiang.hw.service;


import co.yixiang.hw.domain.YxWechatUser;
import co.yixiang.hw.service.dto.YxWechatUserDto;
import co.yixiang.hw.service.dto.YxWechatUserQueryCriteria;
import com.alibaba.fastjson.JSONObject;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;

import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Walert
 * @date 2020-05-18
 */
public interface YxWechatUserService {

    /**
     * 查询数据分页
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String,Object>
     */
    Map<String,Object> queryAll(YxWechatUserQueryCriteria criteria, Pageable pageable);

    /**
     * 查询所有数据不分页
     * @param criteria 条件参数
     * @return List<YxWechatUserDto>
     */
    List<YxWechatUserDto> queryAll(YxWechatUserQueryCriteria criteria);

    /**
     * 根据ID查询
     * @param uid ID
     * @return YxWechatUserDto
     */
    YxWechatUserDto findById(Integer uid);

    /**
     * 创建
     * @param resources /
     * @return YxWechatUserDto
     */
    YxWechatUserDto create(YxWechatUser resources);

    /**
     * 编辑
     * @param resources /
     */
    void update(YxWechatUser resources);

    /**
     * 多选删除
     * @param ids /
     */
    void deleteAll(Integer[] ids);

    /**
     * 导出数据
     * @param all 待导出的数据
     * @param response /
     * @throws IOException /
     */
    void download(List<YxWechatUserDto> all, HttpServletResponse response) throws IOException;

    @Async
    void asyncSaveWechatUserInfo(Integer uid, JSONObject userInfo);
}